package com.gitee.feizns.explore.data_structure.tree.bs.easy;

/**
 * 面试题27. 二叉树的镜像
 * @author feizns
 * @since 2020/3/9
 */
public class MirrorTree {

    public static TreeNode mirrorTree(TreeNode root) {
        if ( root != null ) {
            mirrorTree(root.left);
            mirrorTree(root.right);
            TreeNode left = root.left;
            root.left = root.right;
            root.right = left;
            return root;
        }
        return null;
    }

}
